#if WIN32 || WIN64
#include "windows/buttons_impl.h"
#endif
#include "buttons.h"

int const flip_keys_flip_to_native[flip_kbRangeEnd + 1] =
{
    flip_native_kbEscape,
	flip_native_kbF1,
	flip_native_kbF2,
	flip_native_kbF3,
	flip_native_kbF4,
	flip_native_kbF5,
	flip_native_kbF6,
	flip_native_kbF7,
	flip_native_kbF8,
	flip_native_kbF9,
	flip_native_kbF10,
	flip_native_kbF11,
	flip_native_kbF12,
	flip_native_kb0,
	flip_native_kb1,
	flip_native_kb2,
	flip_native_kb3,
	flip_native_kb4,
	flip_native_kb5,
	flip_native_kb6,
	flip_native_kb7,
	flip_native_kb8,
	flip_native_kb9,
	flip_native_kbTab,
	flip_native_kbReturn,
	flip_native_kbSpace,
	flip_native_kbLeftShift,
	flip_native_kbRightShift,
	flip_native_kbLeftControl,
	flip_native_kbRightControl,
	flip_native_kbLeftAlt,
	flip_native_kbRightAlt,
	flip_native_kbLeftMeta,
	flip_native_kbRightMeta,
	flip_native_kbBackspace,
	flip_native_kbLeft,
	flip_native_kbRight,
	flip_native_kbUp,
	flip_native_kbDown,
	flip_native_kbHome,
	flip_native_kbEnd,
	flip_native_kbInsert,
	flip_native_kbDelete,
	flip_native_kbPageUp,
	flip_native_kbPageDown,
	flip_native_kbEnter,
	flip_native_kbNumpad0,
	flip_native_kbNumpad1,
	flip_native_kbNumpad2,
	flip_native_kbNumpad3,
	flip_native_kbNumpad4,
	flip_native_kbNumpad5,
	flip_native_kbNumpad6,
	flip_native_kbNumpad7,
	flip_native_kbNumpad8,
	flip_native_kbNumpad9,
	flip_native_kbNumpadAdd,
	flip_native_kbNumpadSubtract,
	flip_native_kbNumpadMultiply,
	flip_native_kbNumpadDivide,
	
	flip_native_kbQ,
	flip_native_kbW,
	flip_native_kbE,
	flip_native_kbR,
	flip_native_kbT,
	flip_native_kbY,
	flip_native_kbU,
	flip_native_kbI,
	flip_native_kbO,
	flip_native_kbP,
	flip_native_kbLeftBracket,
	flip_native_kbRightBracket,
	flip_native_kbA,
	flip_native_kbS,
	flip_native_kbD,
	flip_native_kbF,
	flip_native_kbG,
	flip_native_kbH,
	flip_native_kbJ,
	flip_native_kbK,
	flip_native_kbL,
	flip_native_kbSemicolon,
	flip_native_kbApostrophe,
	flip_native_kbGrave,    /* accent grave */
	flip_native_kbBackslash,
	flip_native_kbZ,
	flip_native_kbX,
	flip_native_kbC,
	flip_native_kbV,
	flip_native_kbB,
	flip_native_kbN,
	flip_native_kbM
};

int flip_keys_native_to_flip[flip_native_kbRangeEnd + 1] = {0};

void flip_init_keys_native_to_flip()
{
	int i;
	
	for(i = 0; i <= flip_native_kbRangeEnd; ++i)
	{
		flip_keys_native_to_flip[i] = -1;
	}
	
	for(i = flip_kbRangeBegin; i <= flip_kbRangeEnd; ++i)
	{
		flip_keys_native_to_flip[flip_keys_flip_to_native[i]] = i;
	}
}
